using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
using WFTools;

[Serializable]
public class CampaignStageSettings 
{ 
	/// <summary>
	///ID
	/// <summary>

	public readonly int ID;
	/// <summary>
	///名称
	/// <summary>

	public readonly string NameID;
	/// <summary>
	///图标
	/// <summary>

	public readonly string Icon;
	/// <summary>
	///枚举测试
	/// <summary>

	public readonly Month EnumTest;
	/// <summary>
	///描述
	/// <summary>

	public readonly string DescID;
	/// <summary>
	///本关怪物
	/// <summary>

	public readonly int[] MonsterShowID;
	/// <summary>
	///难度
	///0、无
	///1、普通
	///2、精英
	/// <summary>

	public readonly int StageQuality;
	/// <summary>
	///显示位置
	///由左至右1~5
	/// <summary>

	public readonly int pos;
	/// <summary>
	///体力消耗
	/// <summary>

	public readonly int StaminaNormal;
	/// <summary>
	///归属星球
	/// <summary>

	public readonly int PlanetRef;
	/// <summary>
	///关卡序列
	/// <summary>

	public readonly float StageIndex;
	/// <summary>
	///怪物波次序列
	/// <summary>

	public readonly string[] MonsterWaveIDs;
	/// <summary>
	///等级需求
	/// <summary>

	public readonly int LevelReq;
	/// <summary>
	///前置关卡
	/// <summary>

	public readonly int[] PreStage;
	/// <summary>
	///Type类型测试
	/// <summary>

	public readonly List<MonsterWaveConfig> monsterWaveConfig;
	/// <summary>
	///基础奖励1
	/// <summary>

	public readonly Dictionary<string,int> BasicReward1;
	/// <summary>
	///星级奖励1
	/// <summary>

	public readonly Dictionary<string,int> MedalReward1;
	/// <summary>
	///星级奖励2
	/// <summary>

	public readonly Dictionary<string,int> MedalReward2;
	/// <summary>
	///星级奖励3
	/// <summary>

	public readonly Dictionary<string,int> MedalReward3;
	/// <summary>
	///过关条件波次
	/// <summary>

	public readonly int TargetWaveCount;
	/// <summary>
	///过关条件击杀id
	/// <summary>

	public readonly string TargetKill;
	/// <summary>
	///过关条件击杀数量
	/// <summary>

	public readonly int KillCount;
	/// <summary>
	///过关条件时间
	/// <summary>

	public readonly float TargetTime;
	/// <summary>
	///关卡内音乐
	/// <summary>

	public readonly string Music;
	/// <summary>
	///关卡预置体ID
	/// <summary>

	public readonly string MapID;
	/// <summary>
	///怪物血量修正
	///用以提升该关卡内怪物的血量
	/// <summary>

	public readonly float MobHp_Modifier;
	/// <summary>
	///怪物攻击修正
	///用以提升该关卡内怪物的攻击力
	/// <summary>

	public readonly float MobAtk_Modifier;
	/// <summary>
	///战斗内升级经验 系数
	/// <summary>

	public readonly float ExtpRatio;
	public CampaignStageSettings(List<string> datas)
{	
		int value = 0;
		ID = int.Parse(datas[0]);
		NameID = datas[2];
		Icon = datas[3];
		if (int.TryParse(datas[4],out value))EnumTest = (Month)int.Parse(datas[4]); else EnumTest = (Month)Enum.Parse(typeof(Month),datas[4]);
		DescID = datas[5];
		MonsterShowID = Array.ConvertAll(datas[6].Split('|'), int.Parse);
		StageQuality = int.Parse(datas[7]);
		pos = int.Parse(datas[8]);
		StaminaNormal = int.Parse(datas[9]);
		PlanetRef = int.Parse(datas[10]);
		StageIndex = float.Parse(datas[11]);
		MonsterWaveIDs = datas[12].Split('|');
		LevelReq = int.Parse(datas[13]);
		PreStage = Array.ConvertAll(datas[14].Split('|'), int.Parse);
		monsterWaveConfig = TableDataMgr.Instance.ConvertTypeList<MonsterWaveConfig>(datas[15],'\n',',',s => new MonsterWaveConfig(s));
		BasicReward1 = TableDataMgr.Instance.ConvertMap<string,int>(datas[16],':','|',s => s, int.Parse);
		MedalReward1 = TableDataMgr.Instance.ConvertMap<string,int>(datas[17],':','|',s => s, int.Parse);
		MedalReward2 = TableDataMgr.Instance.ConvertMap<string,int>(datas[18],':','|',s => s, int.Parse);
		MedalReward3 = TableDataMgr.Instance.ConvertMap<string,int>(datas[19],':','|',s => s, int.Parse);
		TargetWaveCount = int.Parse(datas[20]);
		TargetKill = datas[21];
		KillCount = int.Parse(datas[22]);
		TargetTime = float.Parse(datas[23]);
		Music = datas[24];
		MapID = datas[25];
		MobHp_Modifier = float.Parse(datas[26]);
		MobAtk_Modifier = float.Parse(datas[27]);
		ExtpRatio = float.Parse(datas[28]);
	}
} 
